<?php

// require_once 'Zend/Gdata/Extension.php';
require_once dirname(__FILE__) . '/../../Extension/Params.php';
require_once dirname(__FILE__) . '/TextValues.php';

class Rats_Extension_FormatParams extends Raws_Extension_Params
{

    // protected $_rootNamespace = 'raws';
    // protected $_rootElement = 'video_height';
 
    protected $_id = null;
    protected $_name = null;
    protected $_description = null;
    protected $_category = null;
    protected $_container = null;
    protected $_video_codec = null;
    protected $_video_bitrate = null;
    protected $_video_fps = null;
    protected $_video_width = null;
    protected $_video_height = null;
    protected $_video_deinterlace = null;
    protected $_audio_channel = null;
    protected $_audio_codec = null;
    protected $_audio_bitrate = null;
    protected $_audio_sample_rate = null;
    protected $_audio_passes = null;
    protected $_audio_track_mapping = null;
    protected $_video_cq = null;
    protected $_video_passes = null;
    protected $_video_crop_top = null;
    protected $_video_crop_bottom = null;
    protected $_video_crop_right = null;
    protected $_video_crop_left = null;
    protected $_video_aspect_ratio = null;
    protected $_hinting = null;
    protected $_input = null;
    protected $_output = null;
    protected $_overlay = null;

    public function __construct($name = null, $description = null, $category = null, $container = null, $video_codec = null) 
    {
        parent::__construct();
        // $this->_id = $id;
        $this->_name = $name;
        $this->_description = $description;
        $this->_category = $category;
        $this->_container = $container;
        $this->_video_codec = $video_codec;
    }
    
    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     *          child properties.
     */
    public function getDOM($doc = null)
    {
        $element = parent::getDOM($doc);
        if ($this->_id !== null) {
            $element->appendChild($this->_id->getDOM($element->ownerDocument));
        }
        if ($this->_name !== null) {
            $element->appendChild($this->_name->getDOM($element->ownerDocument));
        }
        if ($this->_description !== null) {
            $element->appendChild($this->_description->getDOM($element->ownerDocument));
        }
        if ($this->_category !== null) {
            $element->appendChild($this->_category->getDOM($element->ownerDocument));
        }
        if ($this->_container !== null) {
            $element->appendChild($this->_container->getDOM($element->ownerDocument));
        }
        if ($this->_video_codec !== null) {
            $element->appendChild($this->_video_codec->getDOM($element->ownerDocument));
        }
        if ($this->_video_bitrate !== null) {
            $element->appendChild($this->_video_bitrate->getDOM($element->ownerDocument));
        }
        if ($this->_video_fps !== null) {
            $element->appendChild($this->_video_fps->getDOM($element->ownerDocument));
        }
        if ($this->_video_width !== null) {
            $element->appendChild($this->_video_width->getDOM($element->ownerDocument));
        }
        if ($this->_video_height !== null) {
            $element->appendChild($this->_video_height->getDOM($element->ownerDocument));
        }        
        if ($this->_video_deinterlace !== null) {
            $element->appendChild($this->_video_deinterlace->getDOM($element->ownerDocument));
        }
        if ($this->_audio_channel !== null) {
            $element->appendChild($this->_audio_channel->getDOM($element->ownerDocument));
        }
        if ($this->_audio_codec !== null) {
            $element->appendChild($this->_audio_codec->getDOM($element->ownerDocument));
        }
        if ($this->_audio_bitrate !== null) {
            $element->appendChild($this->_audio_bitrate->getDOM($element->ownerDocument));
        }
        if ($this->_audio_sample_rate !== null) {
            $element->appendChild($this->_audio_sample_rate->getDOM($element->ownerDocument));
        }
        if ($this->_audio_passes !== null) {
            $element->appendChild($this->_audio_passes->getDOM($element->ownerDocument));
        }
        if ($this->_audio_track_mapping !== null) {
            $element->appendChild($this->_audio_track_mapping->getDOM($element->ownerDocument));
        }
        if ($this->_video_cq !== null) {
            $element->appendChild($this->_video_cq->getDOM($element->ownerDocument));
        }
        if ($this->_video_passes !== null) {
            $element->appendChild($this->_video_passes->getDOM($element->ownerDocument));
        }
        if ($this->_video_crop_top !== null) {
            $element->appendChild($this->_video_crop_top->getDOM($element->ownerDocument));
        }
        if ($this->_video_crop_bottom !== null) {
            $element->appendChild($this->_video_crop_bottom->getDOM($element->ownerDocument));
        }
        if ($this->_video_crop_right !== null) {
            $element->appendChild($this->_video_crop_right->getDOM($element->ownerDocument));
        }
        if ($this->_video_crop_left !== null) {
            $element->appendChild($this->_video_crop_left->getDOM($element->ownerDocument));
        }
        if ($this->_video_aspect_ratio !== null) {
            $element->appendChild($this->_video_aspect_ratio->getDOM($element->ownerDocument));
        }        
        if ($this->_hinting !== null) {
            $element->appendChild($this->_hinting->getDOM($element->ownerDocument));
        }
        if ($this->_input !== null) {
            $element->appendChild($this->_input->getDOM($element->ownerDocument));
        }
        if ($this->_output !== null) {
            $element->appendChild($this->_output->getDOM($element->ownerDocument));
        }
        if ($this->_overlay !== null) {
            $element->appendChild($this->_overlay->getDOM($element->ownerDocument));
        }

        return $element;
    }

    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        
        switch ($absoluteNodeName) {
            case $this->lookupNamespace('raws') . ':' . 'id'; 
                $id = new Rats_Extension_Name();
                $id->transferFromDOM($child);
                $this->_id = $id;
                break;
            case $this->lookupNamespace('raws') . ':' . 'name'; 
                $name = new Rats_Extension_Name();
                $name->transferFromDOM($child);
                $this->_name = $name;
                break;
            case $this->lookupNamespace('raws') . ':' . 'description'; 
                $description = new Rats_Extension_Description();
                $description->transferFromDOM($child);
                $this->_description = $description;
                break;
            case $this->lookupNamespace('raws') . ':' . 'category'; 
                $category = new Rats_Extension_Category();
                $category->transferFromDOM($child);
                $this->_category = $category;
                break;
            case $this->lookupNamespace('raws') . ':' . 'container'; 
                $container = new Rats_Extension_Container();
                $container->transferFromDOM($child);
                $this->_container = $container;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_codec'; 
                $video_codec = new Rats_Extension_VideoCodec();
                $video_codec->transferFromDOM($child);
                $this->_video_codec = $video_codec;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_bitrate'; 
                $video_bitrate = new Rats_Extension_VideoBitrate();
                $video_bitrate->transferFromDOM($child);
                $this->_video_bitrate = $video_bitrate;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_fps'; 
                $video_fps = new Rats_Extension_VideoFps();
                $video_fps->transferFromDOM($child);
                $this->_video_fps = $video_fps;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_width'; 
                $video_width = new Rats_Extension_VideoWidth();
                $video_width->transferFromDOM($child);
                $this->_video_width = $video_width;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_height'; 
                $video_height = new Rats_Extension_VideoHeight();
                $video_height->transferFromDOM($child);
                $this->_video_height = $video_height;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_deinterlace'; 
                $video_deinterlace = new Rats_Extension_VideoDeinterlace();
                $video_deinterlace->transferFromDOM($child);
                $this->_video_deinterlace = $video_deinterlace;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_channel'; 
                $audio_channel = new Rats_Extension_AudioChannel();
                $audio_channel->transferFromDOM($child);
                $this->_audio_channel = $audio_channel;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_codec'; 
                $audio_codec = new Rats_Extension_AudioCodec();
                $audio_codec->transferFromDOM($child);
                $this->_audio_codec = $audio_codec;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_bitrate'; 
                $audio_bitrate = new Rats_Extension_AudioBitrate();
                $audio_bitrate->transferFromDOM($child);
                $this->_audio_bitrate = $audio_bitrate;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_sample_rate'; 
                $audio_sample_rate = new Rats_Extension_AudioSampleRate();
                $audio_sample_rate->transferFromDOM($child);
                $this->_audio_sample_rate = $audio_sample_rate;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_passes'; 
                $audio_passes = new Rats_Extension_AudioPasses();
                $audio_passes->transferFromDOM($child);
                $this->_audio_passes = $audio_passes;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_track_mapping'; 
                $audio_track_mapping = new Rats_Extension_AudioTrackMapping();
                $audio_track_mapping->transferFromDOM($child);
                $this->_audio_track_mapping = $audio_track_mapping;
                break;                
            case $this->lookupNamespace('raws') . ':' . 'video_cq'; 
                $video_cq = new Rats_Extension_VideoCq();
                $video_cq->transferFromDOM($child);
                $this->_video_cq = $video_cq;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_passes'; 
                $video_passes = new Rats_Extension_VideoPasses();
                $video_passes->transferFromDOM($child);
                $this->_video_passes = $video_passes;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_crop_top'; 
                $video_crop_top = new Rats_Extension_VideoCropTop();
                $video_crop_top->transferFromDOM($child);
                $this->_video_crop_top = $video_crop_top;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_crop_bottom'; 
                $video_crop_bottom = new Rats_Extension_VideoCropBottom();
                $video_crop_bottom->transferFromDOM($child);
                $this->_video_crop_bottom = $video_crop_bottom;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_crop_right'; 
                $video_crop_right = new Rats_Extension_VideoCropRight();
                $video_crop_right->transferFromDOM($child);
                $this->_video_crop_right = $video_crop_right;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_crop_left'; 
                $video_crop_left = new Rats_Extension_VideoCropLeft();
                $video_crop_left->transferFromDOM($child);
                $this->_video_crop_left = $video_crop_left;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_aspect_ratio'; 
                $video_aspect_ratio = new Rats_Extension_VideoAspectRatio();
                $video_aspect_ratio->transferFromDOM($child);
                $this->_video_aspect_ratio = $video_aspect_ratio;
                break;
            case $this->lookupNamespace('raws') . ':' . 'hinting'; 
                $hinting = new Rats_Extension_Hinting();
                $hinting->transferFromDOM($child);
                $this->_hinting = $hinting;
                break;
            case $this->lookupNamespace('raws') . ':' . 'input'; 
                $input = new Rats_Extension_Input();
                $input->transferFromDOM($child);
                $this->_input = $input;
                break;
            case $this->lookupNamespace('raws') . ':' . 'output'; 
                $output = new Rats_Extension_Output();
                $output->transferFromDOM($child);
                $this->_output = $output;
                break;
            case $this->lookupNamespace('raws') . ':' . 'overlay'; 
                $overlay = new Rats_Extension_Overlay();
                $overlay->transferFromDOM($child);
                $this->_overlay = $overlay;
                break;
            default:
                parent::takeChildFromDOM($child);
                break;
        }
    }


    public function getId()
    {
        return $this->_id;
    }

    public function setId($value)
    {
        $this->_id = $value;
        return $this;
    }
    
    public function getName()
    {
        return $this->_name;
    }

    public function setName($value)
    {
        $this->_name = $value;
        return $this;
    }

    public function getDescription()
    {
        return $this->_description;
    }

    public function setDescription($value)
    {
        $this->_description = $value;
        return $this;
    }

    public function getCategory()
    {
        return $this->_category;
    }

    public function setCategory($value)
    {
        $this->_category = $value;
        return $this;
    }

    public function getContainer()
    {
        return $this->_container;
    }

    public function setContainer($value)
    {
        $this->_container = $value;
        return $this;
    }

    public function getVideoCodec()
    {
        return $this->_video_codec;
    }

    public function setVideoCodec($value)
    {
        $this->_video_codec = $value;
        return $this;
    }

    public function getVideoBitrate()
    {
        return $this->_video_bitrate;
    }

    public function setVideoBitrate($value)
    {
        $this->_video_bitrate = $value;
        return $this;
    }

    public function getVideoFps()
    {
        return $this->_video_fps;
    }

    public function setVideoFps($value)
    {
        $this->_video_fps = $value;
        return $this;
    }

    public function getVideoWidth()
    {
        return $this->_video_width;
    }

    public function setVideoWidth($value)
    {
        $this->_video_width = $value;
        return $this;
    }

    public function getVideoHeight()
    {
        return $this->_video_height;
    }

    public function setVideoHeight($value)
    {
        $this->_video_height = $value;
        return $this;
    }

    public function getVideoDeinterlace()
    {
        return $this->_video_deinterlace;
    }

    public function setVideoDeinterlace($value)
    {
        $this->_video_deinterlace = $value;
        return $this;
    }

    public function getAudioChannel()
    {
        return $this->_audio_channel;
    }

    public function setAudioChannel($value)
    {
        $this->_audio_channel = $value;
        return $this;
    }

    public function getAudioCodec()
    {
        return $this->_audio_codec;
    }

    public function setAudioCodec($value)
    {
        $this->_audio_codec = $value;
        return $this;
    }

    public function getAudioBitrate()
    {
        return $this->_audio_bitrate;
    }

    public function setAudioBitrate($value)
    {
        $this->_audio_bitrate = $value;
        return $this;
    }

    public function getAudioSampleRate()
    {
        return $this->_audio_sample_rate;
    }

    public function setAudioSampleRate($value)
    {
        $this->_audio_sample_rate = $value;
        return $this;
    }

    public function getAudioPasses()
    {
        return $this->_audio_passes;
    }

    public function setAudioPasses($value)
    {
        $this->_audio_passes = $value;
        return $this;
    }

    public function getAudioTrackMapping()
    {
        return $this->_audio_track_mapping;
    }

    public function setAudioTrackMapping($value)
    {
        $this->_audio_track_mapping = $value;
        return $this;
    }

    public function getVideoCq()
    {
        return $this->_video_cq;
    }

    public function setVideoCq($value)
    {
        $this->_video_cq = $value;
        return $this;
    }

    public function getVideoPasses()
    {
        return $this->_video_passes;
    }

    public function setVideoPasses($value)
    {
        $this->_video_passes = $value;
        return $this;
    }

    public function getVideoCropTop()
    {
        return $this->_video_crop_top;
    }

    public function setVideoCropTop($value)
    {
        $this->_video_crop_top = $value;
        return $this;
    }

    public function getVideoCropBottom()
    {
        return $this->_video_crop_bottom;
    }

    public function setVideoCropBottom($value)
    {
        $this->_video_crop_bottom = $value;
        return $this;
    }

    public function getVideoCropRight()
    {
        return $this->_video_crop_right;
    }

    public function setVideoCropRight($value)
    {
        $this->_video_crop_right = $value;
        return $this;
    }

    public function getVideoCropLeft()
    {
        return $this->_video_crop_left;
    }

    public function setVideoCropLeft($value)
    {
        $this->_video_crop_left = $value;
        return $this;
    }

    public function getVideoAspectRatio()
    {
        return $this->_video_aspect_ratio;
    }

    public function setVideoAspectRatio($value)
    {
        $this->_video_aspect_ratio = $value;
        return $this;
    }

    public function getHinting()
    {
        return $this->_hinting;
    }

    public function setHinting($value)
    {
        $this->_hinting = $value;
        return $this;
    }

    public function getInput()
    {
        return $this->_input;
    }

    public function setInput($value)
    {
        $this->_input = $value;
        return $this;
    }

    public function getOutput()
    {
        return $this->_output;
    }

    public function setOutput($value)
    {
        $this->_output = $value;
        return $this;
    }

    public function getOverlay()
    {
        return $this->_overlay;
    }

    public function setOverlay($value)
    {
        $this->_overlay = $value;
        return $this;
    }

}
